// tab类型
const TabType = {
  LONGTERM_ELECTRICITYPRICE_FORECAST: {
    value: '0',
    label: '长周期电价预测',
  },
  HISTORY_SEQ_PRICE: {
    value: '1',
    label: '历史序列价格',
  },
  SEQUENCE_PROPORTION_ANALYSIS: {
    value: '2',
    label: '市场成交行情分析',
  },
  // MARKET_TRACKING: {
  //   value: '1',
  //   label: '标的行情跟踪',
  // },
  // UPSTREAM_POWER_PRICE: {
  //   value: '2',
  //   label: '上游能源价格',
  // },
};

// 交易类型
const TradeType = {
  CENTRALIZED: {
    value: '0',
    label: '集中竞价',
  },
  ROLLING: {
    value: '1',
    label: '滚动撮合',
  },
};

// 格式化名称
const formatName = (data, index) => {
  if (data.split('-').length && data.split('-').length > 1) {
    const dataArr = data.split('-');
    return dataArr.slice(index || 0).join('');
  }
  return data;
};
const descrip = (
  <>
    <div>预测数据正在疯狂开发</div>
    <div>中，请耐心等待！</div>
  </>
);
const tenDaysTypeOptions = [
  { value: '旬', label: '旬' },
  { value: '月', label: '月' },
];
const kLineOptions = [
  { value: '日K', label: '日K' },
  { value: '周K', label: '周K' },
  { value: '月K', label: '月K' },
];
const continuousAverageOptions = [
  { value: '连续', label: '连续' },
  { value: '平均', label: '平均' },
];
const tenDaysSecondsOptions = [
  { value: '1-10', label: '1-10日' },
  { value: '11-20', label: '11-20日' },
  { value: '21-30', label: '21-30日' },
];
const dateTimeorderOptions = [
  { value: '日期', label: '日期' },
  { value: '时点', label: '时点' },
];
const pointConvert = (num = 0, point = 96) => {
  let _num;
  if (point === 24) {
    _num = num * 100;
  } else {
    _num = num % 4 == 0 ? num * 25 : num / 4 > 0 ? num * 15 + Math.floor(num / 4) * 40 : num * 15;
  }
  return _num < 100 ? '00' + _num : _num < 1000 ? '0' + _num : _num.toString();
};

export {
  TabType,
  TradeType,
  formatName,
  descrip,
  tenDaysTypeOptions,
  kLineOptions,
  continuousAverageOptions,
  tenDaysSecondsOptions,
  pointConvert,
  dateTimeorderOptions,
};
